package com.weasel.weixin.commons.message.builder.initiative;

import com.weasel.weixin.commons.message.bean.initiative.VoiceCustomInitiativeMessage;

/**
 * Created by Dylan on 2015/10/19.
 */
public class VoiceCustomInitiativeMessageBuilder extends AbstractCustomInitiativeMessageBuilder<VoiceCustomInitiativeMessageBuilder,VoiceCustomInitiativeMessage> {


    public VoiceCustomInitiativeMessageBuilder() {
        super(new VoiceCustomInitiativeMessage());
    }

    public VoiceCustomInitiativeMessageBuilder mediaId(String mediaId){

        getVoice().setMediaId(mediaId);
        return this;
    }

    private VoiceCustomInitiativeMessage.Voice getVoice(){

        VoiceCustomInitiativeMessage.Voice voice = ((VoiceCustomInitiativeMessage)message).getVoice();
        if(null == voice){
            voice = new VoiceCustomInitiativeMessage.Voice();
            ((VoiceCustomInitiativeMessage) message).setVoice(voice);
        }
        return voice;
    }
}
